Historical updating oE subtract, Revision 1

subtract

include datetime.e 
namespace datetime 
public function subtract(datetime dt, atom qty, integer interval) 

subtracts a number of intervals to a base datetime.

Parameters:
  1. dt : the base datetime
  2. qty : the number of intervals to subtract. It should be positive.
  3. interval : which kind of interval to subtract.
Returns:

A sequence, more precisely a datetime representing the new moment in time.

Comments:

Please see Constants for Date and Time for a reference of valid intervals.

See the function add for more information on adding and subtracting date intervals

Example 1:
dt2 = subtract(dt1, 18, MINUTES) -- subtract 18 minutes from dt1 
dt2 = subtract(dt1, 7, MONTHS)   -- subtract 7 months from dt1 
dt2 = subtract(dt1, 12, HOURS)   -- subtract 12 hours from dt1 
See Also:

add, diff

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu